﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
    CodeFile="Processes.aspx.cs" Inherits="Processes" Title="Processes" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <style type="text/css">
        tr.item
        {
            background-color: #EFF3FB;
        }
        tr.item2
        {
            background-color: White;
            color: #284775;
        }
        thead > tr
        {
            background-color: #5D7B9D;
            font-weight: bold;
            color: White;
            text-align: left;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="content" runat="Server">
    <asp:ListView ID="lvProcesses" runat="server">
        <LayoutTemplate>
            <table style="width: 100%" cellspacing="0" cellpadding="4">
                <thead>
                    <tr>
                        <th>
                            Process
                        </th>
                        <th>
                            PID
                        </th>
                        <th>
                            Monitor type
                        </th>
                        <th>
                            Memory usage
                        </th>
                    </tr>
                </thead>
                <tbody>
                    <tr id="itemPlaceholder" runat="server" />
                </tbody>
            </table>
        </LayoutTemplate>
        <ItemTemplate>
            <tr class="item">
                <td>
                    <asp:Image ID="Image1" runat="server" ImageUrl='<%#Eval("State", "~/Images/Processes/{0}.JPG")%>' />
                    <%#Eval("ProcessName") %>
                </td>
                <td>
                    <%#Eval("Id") %>
                </td>
                <td>
                    <%#GetMonitorFriendlyName(Container.DataItem) %>
                </td>
                <td>
                    <%#GetFriendlyMemoryUsage(Container.DataItem) %>
                </td>
            </tr>
        </ItemTemplate>
        
        <AlternatingItemTemplate>
            <tr class="item2">
                <td>
                    <asp:Image ID="Image1" runat="server" ImageUrl='<%#Eval("State", "~/Images/Processes/{0}.JPG")%>' />
                    <%#Eval("ProcessName") %>
                </td>
                <td>
                    <%#Eval("Id") %>
                </td>
                <td>
                    <%#GetMonitorFriendlyName(Container.DataItem) %>
                </td>
                <td>
                    <%#GetFriendlyMemoryUsage(Container.DataItem) %>
                </td>
            </tr>
        </AlternatingItemTemplate>
    </asp:ListView>
</asp:Content>
